package com.xcity.game.battle.pve.employee.impl;

import com.xcity.game.battle.pve.PlayerBattler;
import com.xcity.game.battle.pve.employee.EmployeeSkillBattleContext;
import com.xcity.game.common.GameStaticConfig;
import com.xcity.game.employee.skill.EmployeeSkill;

//{1=90098#0}{2=90099#0}{3=90100#0}共同出场时，在谈判中有{0=21#0}%几率使玩家下一次攻击直接秒杀对方
public class SKILL_36_CONTEXT extends EmployeeSkillBattleContext {

	private boolean triggered;
	
	public SKILL_36_CONTEXT(PlayerBattler player, EmployeeSkill ref) {
		super(player, ref);
	}

	@Override
	public boolean trigger() {
		if (triggered) {
			triggered = false;
			player.getContext().getTarget().setHp(0);
			return true;
		}
		int n = rnd.nextInt(GameStaticConfig.percentBase);
		if (n < ref.getTemplate().getInitVal(0)) {
			triggered = true;
		}
		return false;
	}

}
